package health.lm.com.router;


import android.support.v4.app.Fragment;

import com.alibaba.android.arouter.launcher.ARouter;

/**
 * 路由中心
 */
public class RouterCenter {

    /**
     * 获取主页面
     */
    public static Fragment toHome() {
        Fragment fragment = (Fragment) ARouter.getInstance().build(ARouterConstant.HomeFragment).navigation();
        if (fragment == null) {
            fragment = new Fragment();
        }
        return fragment;
    }

    /**
     * 人脉链
     */
    public static Fragment toContacts() {
        Fragment fragment = (Fragment) ARouter.getInstance().build(ARouterConstant.HLPeopleChainFragment).navigation();
        if (fragment == null) {
            fragment = new Fragment();
        }
        return fragment;
    }

    /**
     * 链活动
     */
    public static Fragment toActivity() {
        Fragment fragment = (Fragment) ARouter.getInstance().build(ARouterConstant.ActivityFragment).navigation();
        if (fragment == null) {
            fragment = new Fragment();
        }
        return fragment;
    }

    /**
     * 我的页面
     */
    public static Fragment toMine() {
        Fragment fragment = (Fragment) ARouter.getInstance().build(ARouterConstant.MineFragment).navigation();
        if (fragment == null) {
            fragment = new Fragment();
        }
        return fragment;
    }

}
